/*--------------------------------------------------------------------------------------+
|
|     $Source: samples/SampleDgnDbEditor/MoveShipping%Class%Tool.h $
|
|  $Copyright: (c) 2014 Bentley Systems, Incorporated. All rights reserved. $
|
+--------------------------------------------------------------------------------------*/
#pragma once
#include "SampleDgnDbEditor.h"

//=======================================================================================
// Sample tool that moves a shipping %ClassDown%
// @bsiclass                                                BentleySystems
//=======================================================================================
struct MoveShipping%Class%Tool : public DgnPlatform::DgnPrimitiveTool
{
    DEFINE_T_SUPER (DgnPlatform::DgnPrimitiveTool)

private:
    DgnModelR m_writeModel;
    IECInstancePtr m_itemPtr;
    ElementId m_moveElementId;
    ECInstanceKey m_moveItemKey;

    bool IsMoveInProgress() {return m_moveElementId.IsValid();}
    bool IsMoveValid (ECClassId);

protected:
    virtual Utf8CP _GetToolId () const override {return SampleDgnDbEditorApp::TOOLID_MoveShipping%Class%();}
    virtual void _OnPostInstall() override;
    virtual void _OnRestartTool() override;
    virtual bool _OnDataButton (DgnButtonEventCP) override;
    virtual bool _OnResetButton (DgnButtonEventCP) override;
    virtual void _OnDynamicFrame (DgnButtonEventCP) override;

public:
    MoveShipping%Class%Tool (DgnModelR writeModel);
};
